import type {App} from 'vue';
import VXETable from 'vxe-table';
import 'vxe-table/lib/style.css';

VXETable.config({
  table: {
    stripe: true,
    border: 'full',
    size: 'mini',
    align: 'center',
    rowConfig: {
      isHover: true,
      isCurrent: true,
    },
    columnConfig: {
      resizable: true,
    },
    scrollY: {
      scrollToTopOnChange: true,
      gt: 100,
      mode: 'wheel',
    },
  },
  pager: {
    align: 'center',
    size: 'small',
    autoHidden: false,
    perfect: true,
    pageSize: 10,
    pagerCount: 7,
    pageSizes: [10, 15, 20, 50, 100],
    layouts: ['PrevJump', 'PrevPage', 'JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total'],
  },
});
export function setupVXETable(app: App<Element>) {
  app.use(VXETable);
}